/**
 * Created by Administrator on 2019/8/26/026.
 */
import CZML_GENERALTOOLS_CLASS from "../main/CZML_GENERALTOOLS_CLASS.js"

class CZML_Point {
  constructor(viewer, id, name, position, fillColor, outlineColor, outlineWidth, pixelSize) {
    this._viewer = viewer
    this.id = id
    this.name = name
    this.position = position
    this.fillColor = fillColor
    this.outlineColor = outlineColor
    this.outlineWidth = outlineWidth
    this.pixelSize = pixelSize
    this.AddPoint()
  }

  AddPoint() {
    const point = {
      id: this.id,
      name: this.name,
      position: {
        cartographicDegrees: this.position
      },
      point: {
        show: true,
        color: {
          rgba: this.fillColor
        },
        outlineColor: {
          rgba: this.outlineColor
        },
        outlineWidth: this.outlineWidth,
        pixelSize: this.pixelSize
      }
    }
    // 插入该数据对象
    const ret = CZML_GENERALTOOLS_CLASS.InsertModelObjectInformation(this.id, point, true)
    // 上图
    CZML_GENERALTOOLS_CLASS.Upper(this._viewer)
    return ret
  }
}

export default CZML_Point
